//
//  SPLimitsViewController.m
//  Sport
//
//  Created by Cass on 2018/2/8.
//  Copyright © 2018年 Cass. All rights reserved.
//

#import "SPLimitsViewController.h"

@interface SPLimitsViewController ()
@property (weak, nonatomic) IBOutlet UIButton *allBtn;
@property (weak, nonatomic) IBOutlet UIButton *friendBtn;
@property (assign, nonatomic) BOOL isChoose;
@property (nonatomic, copy) NSString *blockString;
@end

@implementation SPLimitsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self configBasic];
    
}

- (void)configBasic{
    self.allBtn.selected = NO;
    self.friendBtn.selected = NO;
    UIBarButtonItem *rightItem = [UIBarButtonItem itemWithImage:nil selectedImage:nil title:@"确定" target:self action:@selector(rightItemClick:)];
    self.navigationItem.rightBarButtonItem = rightItem;
}

- (void)rightItemClick:(UIBarButtonItem *)item{
    self.block(self.blockString);
    [self.navigationController popViewControllerAnimated:YES];
}
- (IBAction)limitBtnClick:(UIButton *)sender {
    if (sender.tag == 10) {
        self.allBtn.selected = !self.allBtn.selected;
        if (self.allBtn.selected) {
            self.allBtn.imageView.image = [UIImage imageNamed:@"icon_xuanzhong_1"];
            self.blockString = @"所有人";
        }
        
    }else if (sender.tag == 20){
        self.friendBtn.selected = !self.friendBtn.selected;
        if (self.friendBtn.selected) {
            self.friendBtn.imageView.image = [UIImage imageNamed:@"icon_xuanzhong_1"];
            self.blockString = @"好友";
        }
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}


@end
